module Puppet::Parser::Functions
  newfunction(:get_provider_attr,  :type => :rvalue) do |args|
    address = args[0]
    roleid = args[1]
    name=args[2]
    cmd="curl  --insecure -s \"%s/status/getProviderAttr?roleid=%s&name=%s\"" % [address, roleid, name]
    puts cmd
    result = ""
    IO.popen(cmd) { |f| result=f.gets }
    puts result
    result
  end
end
